<template>
  <!-- <el-submenu index="1"> 或者渲染<el-menu-item index="2"> -->
  <el-menu-item v-if="item.nonRenderChild || !item.children" :index="item.path">
    <span v-text="item?.meta?.title" />
  </el-menu-item>
  <el-submenu v-else :index="item.path">
    <template slot="title">
      <span slot="title" v-text="item?.meta?.title" />
    </template>
    <!-- 子元素的内容 -->
    <GMenu v-for="it in item.children" :item="it" :key="it.path" />
  </el-submenu>
</template>

<script>
export default {
  name: "GMenu",
  props: {
    item: {
      type: Object,
      required: true,
    },
  },
  data() {
    return {};
  },
};
</script>

<style lang="" scoped>
</style>